#ifndef __CTIMEMANAGER_20170414_H__
#define __CTIMEMANAGER_20170414_H__

#include "MessageEvent.h"
#include "OSType.h"
#include "Timer.h"
#include "minheap-internal.h"
#include <map>

class CTimer;
class CTimeManager : public IMessageEvent
{
public:
	CTimeManager();
	virtual ~CTimeManager();
	
public:
	Bool   Initialize();
	Int64  GetMinTime();
	Bool   AddTimer(CTimer* lpTimer);
	Bool   DelTimer(CTimer* lpTimer);
	Bool   IsTop(CTimer* lpTimer);
	Bool   DealTimer();
	
protected:
	virtual void OnMessageEvent(Int32 nMessageID, void *wParam, void *lParam);
	
private:
	struct min_heap       				m_timeheap;
	Int32                 				m_nAtomicInit;
};


#endif // !__CTIMEMANAGER_20170414_H__
